<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="/WEB-INF/charles-page.tld" prefix="page"%>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/My97DatePicker/WdatePicker.js">
</script>
<script type="text/javascript">
	function check(){
		var startTime = $("#startTime").val();
		var endTime = $("#endTime").val();
		if(checkTime(startTime,endTime))
			return true;
		else 
			return false;
	}
	
	function checkTime(startTime,endTime){
		if(!isStartEndDate(startTime,endTime)){    
	        alert("开始日期不能大于截止日期");   
	        return false;   
	    }else{
	    	return true;
	    }   
	}
	
	function isStartEndDate(startDate,endDate){   
	    //alert(startDate+"==="+endDate);   
	    if(startDate.length>0&&endDate.length>0){   
	        var startDateTemp = startDate.split(" ");   
	        var endDateTemp = endDate.split(" ");   
	        var arrStartDate = startDateTemp[0].split("-");   
	        var arrEndDate = endDateTemp[0].split("-");   
	        var arrStartTime = startDateTemp[1].split(":");   
	        var arrEndTime = endDateTemp[1].split(":");   
	         var allStartDate = new Date(arrStartDate[0],arrStartDate[1],arrStartDate[2],arrStartTime[0],arrStartTime[1],arrStartTime[2]);   
	         var allEndDate = new Date(arrEndDate[0],arrEndDate[1],arrEndDate[2],arrEndTime[0],arrEndTime[1],arrEndTime[2]);   
	         if(allStartDate.getTime()>allEndDate.getTime()){   
	             return false;   
	         }   
	     }   
	     return true;   
	 } 

</script>
<html>
<head>
<title></title>
<link href="<%=request.getContextPath()%>/css/style.css"
	rel="stylesheet" type="text/css" media="all">
</head>
<body>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<I>操作日志查询列表</I>
	<form action="<%=request.getContextPath() %>/queryLogAdminSuper.html"  onsubmit="return check();">
	<table width=45%" border=0 align="center" cellpadding="3"
								cellspacing="1" bgcolor="#cccccc">
								<tr>
									<td  class=list01 nowrap>操作人 :</td>
									<td  class=list02 nowrap><input
										id="oprAccount" name="oprAccount" value="${oprAccount}" /> <font
										color="red">(支持模糊查询) </font></td>
									<td  class=list01 nowrap>操作对象 :</td>
									<td  class=list02 nowrap><input
										id="targetUser" name="targetUser" value="${targetUser}"/><font
										color="red">(支持模糊查询)  </font></td>
								</tr>
								<tr>
									<td  class=list01 nowrap>起始日期：</td>
									<td  class=list02 nowrap><input type="text" id="startTime" name="startTime" value="${startTime}"
             onclick="WdatePicker({startDate:'当前时间',dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="readonly" style="width:auto;"/></td>
										<td  class=list01 nowrap>截止日期：</td>
									<td  class=list02 nowrap><input type="text" id="endTime" name="endTime" value="${endTime}"
             onclick="WdatePicker({startDate:'当前时间',dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="readonly" style="width:auto;"/></td>
								</tr>
	</table>
	<input style="margin-left: 69%; margin-top: 10px;" type="submit" value="查 询" />
			</form>						
	<br />
	<br />
	<table width="95%" height="22" align="center" cellpadding="3"
		cellspacing="1" bgcolor="#cccccc">
		<tr class=sub_title height=23>
			<td width="10%" height="22">操作人</td>
			<td width="15%">操作对象</td>
			<td width="30%">操作</td>
			<td width="10%">操作时间</td>
		</tr>

		<c:choose>
			<c:when test="${not empty items}">
				<c:forEach items="${items}" var="item" varStatus="vs">
					<tr class=list03_t height=23>
						<td width="10%" height="22">${item.oprAccount}</td>
						<td width="15%">${item.endUser}</td>
						<td width="30%">${opMap[item.operate]}</td>
						<td width="30%">${item.oprTime}</td>
					</tr>
				</c:forEach>
			</c:when>
		</c:choose>
	</table>
	<br />
	<page:page src="${url}" currentPage="${logList.currentPage}"
		totalRec="${logList.count}" maxPerPage="${logList.size}"
		showTotal="true" showAllPages="false" strUnit="条记录" />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</body>
</html>